<?php
/**
 * Created by PhpStorm
 * User: Jhinwy
 * Date: 9/5/24
 * Time: 1:55 PM
 */

namespace app\adminapi\controller;

use app\adminapi\logic\DouyinLogic;
use app\Request;

/**
 * 配置控制器
 *
 * Class ConfigController
 * @package app\adminapi\controller
 */
class DouyinController extends BaseAdminController
{
    public array $notNeedLogin = ['callback'];


    /**
     * 抖音回调
     *
     * @param Request $request
     * @return \think\response\Json
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function callback(Request $request)
    {
        return DouyinLogic::callback($request->all()) ?
            json(['err_no' => 0, 'err_tips' => 'success']) : json(['err_no' => 1, 'err_tips' => 'fail']);
    }
}
